<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
include_once("../config.inc.php");
session_start();
$_DBSite = "Query";
include_once(__DBConnect_File);
include_once(__Language_Path."/selectlanguage_admin.php");
include_once(__Modules_Path."/UserSessions.lib.php");

$arrSiteID = array(
	1 => 1,	
	2 => 2,	11 => 2,	
	3 => 3,	12 => 3,	
	4 => 4,	13 => 4,	
	5 => 5,	14 => 5
);
$intUserGroup = $_SESSION["Admin_Info"] -> MemberGroup;
if($intUserGroup > 30){
	$intSiteID = 30;
}else{
	$intSiteID = $arrSiteID[$intUserGroup];
}
@include_once(__Common_Path."/marquee/Marquee".$intSiteID."_".$_intLang.".php");

$FileTime = trim($_data["FileTime"]);
$intUserNo = getGroupUserNo(1);
if(!UserSession_ReStart(session_id(), $_SESSION["Admin_Info"] -> ID, $_SESSION["Admin_Info"] -> MemberGroup, $_data["sid"]))ErrMsgOutputHTML("LoginError", "AdminNoSession", 1);

//if(empty($MTime) || $MTime <= $FileTime)exit();
$arrM = array();
$strPop = "";
if(sizeof($Marquee) > 0){
	foreach($Marquee as $arrMq){
		if(!preg_match("/,".$_SESSION["Admin_Info"] -> SpGroup.",/", ",".$arrMq["SpGroup"].",") && $_SESSION["Admin_Info"] -> MemberGroup < 20)continue;
		//若是系統資訊且不是網站管理群組，則此訊息忽略
		if($arrMq["isSystem"] == "1" && $_SESSION["Admin_Info"] -> MemberGroup < 30)continue;

		$arrMq["Content"] = str_replace(chr(10), "", $arrMq["Content"]);
		$arrMq["Content"] = str_replace(chr(13), "", $arrMq["Content"]);
		$arrM[] = preg_replace('/<br[^<>]+>/', "", $arrMq["Content"]);
		if($arrMq["isPopup"] == "1"){
			if(!preg_match("/@".$arrMq["ID"].",/", $_SESSION["Admin_Info"] -> PopupNews)){
				$_SESSION["Admin_Info"] -> PopupNews .= "@".$arrMq["ID"].",";
				$arrMq["Content"] = preg_replace('/<[^<>]+>/', "", $arrMq["Content"]);
				$strPop .= "alert('".addslashes($arrMq["Content"])."');\n";
			}
		}
	}
}
@mysql_close($$_Conn);
?><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript">
<!--
parent.intUserNo = <?php print $intUserNo;?>;
parent.intTime = <?php print time();?>;
var MTime = <?php print $MTime;?>;
var Marquee = "<?php print addslashes(join("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ", $arrM));?> ";
parent.ShowMarquee();
<?php print $strPop;?>
//-->
</script>